package com.achen.study.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description:
 * @author: Zhaoliang Chen
 * @time: 2022/3/17
 */

@Configuration
public class RedisConfig {

    @Bean
    public RedissonClient redisson(){
        Config config = new Config();
        //集群模式
//        config.useClusterServers().addNodeAddress("192.168.29.130:6379", "192.168.29.140:6379");
        config.useSingleServer().setAddress("redis://192.168.217.150:6379");
        return Redisson.create(config);
    }



}
